public class Test {
    /*
    题目：
        1000个整数，数值的范围是[0,999]，有且只有2个相同的数，请编写程序找出来
     */
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5,6,7,8,9,1};
        int a = 0;
        for (int i = 0; i < array.length; i++) {
            a ^= array[i];
        }
        for (int i = 0; i < 10; i++) {
            a ^= i;
        }
        System.out.println(a);
    }
}
